matches

pure function matches(regex: text): boolean

Matches this text against the specified regular expression.

Regular expressions use the same syntax as java.util.regex.Pattern.

Examples:

val names = ["Alice", "Victor", "Viktor", "Victoria", "V\\ctor"];
print(names @* { .matches("Vi[a-z]tor") }); // prints [Victor, Viktor]
print(names @* { .matches("Vic.*") }); // prints [Victor, Victoria]
print(names @* { .matches("V\\\\c.*") }); // prints [V\ctor]

Since

0.6.0

Parameters

regex

The regular expression to match against.

See also